package org.apache.dubbo.demo.example.eg11;

import org.apache.dubbo.rpc.RpcContext;

public class DemoServiceImpl implements DemoService {

  @Override
  public String sayHello(String name) {
    boolean providerSide = RpcContext.getContext().isProviderSide();
    String remoteHost = RpcContext.getContext().getRemoteHost();
    String application = RpcContext.getContext().getUrl().getParameter("application");
    System.out.println("providerSide: " + providerSide + ", remoteHost: " + remoteHost + ", application: " + application);
    return "hello, " + name;
  }
}
